<template>
  <div class="step-box">
    <div class="industry-list">
      <div v-for="item in industryList" :key="item.industryCode" class="industry-item" @click="selectIndustry(item)">
        <img class="industry-icon" :src="item.industryImg">
        <p>{{ item.industryName }}</p>
      </div>
    </div>
  </div>

</template>

<script>

import { getIndustryList } from '@/api/common'
export default {
  name: 'Step1',
  data() {
    return {
      industryList: []
    }
  },

  created() {
    this.getIndustryList()
  },

  methods: {

    // 获取行业列表
    getIndustryList() {
      getIndustryList().then(res => {
        this.industryList = res || []
      }).catch(() => {})
    },

    // 选择行业
    selectIndustry(item) {
      this.$emit('click', item.industryCode)
    }
  }
}
</script>

<style lang="scss" scoped>
@import '@/components/Approve/step.scss';
.industry-list{
  padding: 40px 100px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.industry-item{
  margin: 0 30px 30px 0;
  text-align: center;
  cursor: pointer;
}
.industry-icon{
  width: 90px;
  height: 90px;
  border-radius: 50%;
}
</style>
